package it.polimi.traveldream.web;

import java.util.List;

import it.polimi.traveldream.ejb.dto.ProviderDTO;
import it.polimi.traveldream.ejb.eaos.ProviderManagerLocal;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

@ManagedBean(name="providerlistbean")
@ViewScoped
public class ProviderListBean {
	
	@EJB
	private ProviderManagerLocal providerManager;
	
	private List<ProviderDTO> current;
	
	@PostConstruct
	public void init(){
		current= providerManager.getAllProvider();
	}
	public ProviderListBean(){
		
	}
	public List<ProviderDTO> getCurrent() {
		return current;
	}

	public void setCurrent(List<ProviderDTO> current) {
		this.current = current;
	}
	public List<ProviderDTO> getProviderList(){
		return  providerManager.getAllProvider();
	}
	
}
